<tr>
	<td align="right" width="150" class="txt-blck4">Select User: <span class="r">*</span></td>
	<td>
    <select id="username" name="username">
		<?php foreach ($allUsersArray as $temp){ 
            if($temp['user_id']==$userId){ ?>
			<option value="<?php echo $temp['user_id']; ?>" selected ><?php echo $temp['user_username']; ?>
			</option>
			<?php 
            $permsArray=$temp['user_permissions'];
            }} ?>
	</select>
    </td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="1" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(1, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Categories</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="2" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(2, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Stores</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="3" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(3, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Coupons</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="4" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(4, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Banners</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="5" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(5, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Deals</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="6" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(6, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Approve <strong>Shared Coupons</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="7" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(7, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Add, Edit and Delete <strong>Occasions</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="8" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(8, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		View <strong>Countactus</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="9" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(9, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		View <strong>Cronjob</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="10" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(10, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Insert, View <strong>Mailer</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="11" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(11, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Insert, View <strong>StoreDeal</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150" class="txt-blck4">Permission:</td>
	<td class="txt-blck4"><input type="checkbox" value="12" name="permission[]"
	<?php $parray=explode(",", $permsArray); echo in_array(12, $parray)?$checked = 'checked="checked"':$checked=''; ?> />
		Insert, View <strong>PopupOffer</strong>
	</td>
</tr>

<tr>
	<td align="right" width="150">&nbsp;</td>
	<td><input type="submit" value="Submit" /></td>
</tr>
